Skip to content

Controller as keyboard for games without controller support - #39

Merged
narkotrxll merged 2 commits into
mainfrom
feature/gamepad-keys
Oct 16, 2026
Merged

narkotrxll merged 2 commits into
mainfrom
feature/gamepad-keys

Conversation

@narkotrxll

@narkotrxll narkotrxll commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Before: a game that only understands a keyboard could not be played on the TV with a controller, and the shared keyboard is blocked during isolation anyway.

After: Controllers has a "Controller as keyboard" card. Each button, trigger and left-stick direction can press a key inside the isolated game (a WASD preset is one click). The shared keyboard stays blocked; only these keys reach the game, and nothing is sent to other programs.

How: a thread in the hook reads the game's player 1 (tuning applied) about 125 times per second and posts WM_KEYDOWN/WM_KEYUP to the game window with a marker bit in lParam, which the keyboard block and the window shield let through (marker removed before the game's window procedure). GetAsyncKeyState, GetKeyState and GetKeyboardState report these keys as pressed. The key map travels in the tuning message (protocol 7, 72 bytes). Games that read the keyboard through Raw Input or DirectInput are not covered; the card says so.

@narkotrxll
narkotrxll merged commit 848d65a into main Oct 16, 2026
3 checks passed
@narkotrxll
narkotrxll deleted the feature/gamepad-keys branch October 16, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant